package main

import "Head-first-go/chapter09/example4/gadget"

type Player interface {
	Paly(string)
	Stop()
}

func playList(device Player, songs []string) {
	for _, song := range songs {
		device.Paly(song)
	}
	device.Stop()
}

func main() {
	mixtape := []string{"千里之外", "霍元甲", "下雨天", "稻香"}
	var player Player
	player = gadget.TapePlayer{}
	playList(player, mixtape)

	player = gadget.TapeRecorder{}
	playList(player, mixtape)

}
